.class public Lcom/glympse/platform/LocManager$ProviderNetwork;
.super Ljava/lang/Object;
.source "LocManager.java"

# interfaces
.implements Landroid/location/LocationListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/platform/LocManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x4
    name = "ProviderNetwork"
.end annotation


# instance fields
.field protected m_fRunning:Z

.field final synthetic this$0:Lcom/glympse/platform/LocManager;


# direct methods
.method protected constructor <init>(Lcom/glympse/platform/LocManager;)V
    .locals 1
    .parameter

    .prologue
    .line 396
    iput-object p1, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->this$0:Lcom/glympse/platform/LocManager;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 398
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->m_fRunning:Z

    return-void
.end method


# virtual methods
.method protected Start()Z
    .locals 7

    .prologue
    .line 406
    :try_start_0
    iget-object v0, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->this$0:Lcom/glympse/platform/LocManager;

    iget-object v0, v0, Lcom/glympse/platform/LocManager;->m_oLocationManager:Landroid/location/LocationManager;

    if-nez v0, :cond_0

    .line 408
    iget-object v1, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->this$0:Lcom/glympse/platform/LocManager;

    sget-object v0, Lcom/glympse/platform/Platform;->m_oContext:Landroid/content/Context;

    const-string v2, "location"

    invoke-virtual {v0, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/location/LocationManager;

    iput-object v0, v1, Lcom/glympse/platform/LocManager;->m_oLocationManager:Landroid/location/LocationManager;

    .line 411
    :cond_0
    iget-boolean v0, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->m_fRunning:Z

    if-nez v0, :cond_1

    .line 413
    const-string v0, "Starting Network Provider"

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 416
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->m_fRunning:Z

    .line 419
    iget-object v0, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->this$0:Lcom/glympse/platform/LocManager;

    iget-object v0, v0, Lcom/glympse/platform/LocManager;->m_oLocationManager:Landroid/location/LocationManager;

    const-string v1, "network"

    const-wide/16 v2, 0x0

    const/4 v4, 0x0

    move-object v5, p0

    invoke-virtual/range {v0 .. v5}, Landroid/location/LocationManager;->requestLocationUpdates(Ljava/lang/String;JFLandroid/location/LocationListener;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 428
    :cond_1
    :goto_0
    iget-boolean v0, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->m_fRunning:Z

    return v0

    .line 422
    :catch_0
    move-exception v0

    move-object v6, v0

    .line 424
    .local v6, e:Ljava/lang/Exception;
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->m_fRunning:Z

    .line 425
    invoke-static {v6}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method protected Stop()V
    .locals 2

    .prologue
    .line 434
    iget-boolean v1, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->m_fRunning:Z

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->this$0:Lcom/glympse/platform/LocManager;

    iget-object v1, v1, Lcom/glympse/platform/LocManager;->m_oLocationManager:Landroid/location/LocationManager;

    if-eqz v1, :cond_0

    .line 436
    const-string v1, "Stopping Network Provider"

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 439
    :try_start_0
    iget-object v1, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->this$0:Lcom/glympse/platform/LocManager;

    iget-object v1, v1, Lcom/glympse/platform/LocManager;->m_oLocationManager:Landroid/location/LocationManager;

    invoke-virtual {v1, p0}, Landroid/location/LocationManager;->removeUpdates(Landroid/location/LocationListener;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 445
    :goto_0
    const/4 v1, 0x0

    iput-boolean v1, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->m_fRunning:Z

    .line 447
    :cond_0
    return-void

    .line 441
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 443
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method public onLocationChanged(Landroid/location/Location;)V
    .locals 4
    .parameter "oLocation"

    .prologue
    .line 452
    if-eqz p1, :cond_0

    .line 456
    :try_start_0
    iget-object v1, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->this$0:Lcom/glympse/platform/LocManager;

    iget-object v2, p0, Lcom/glympse/platform/LocManager$ProviderNetwork;->this$0:Lcom/glympse/platform/LocManager;

    const/4 v3, 0x2

    invoke-virtual {v2, p1, v3}, Lcom/glympse/platform/LocManager;->CreateLocPoint(Landroid/location/Location;I)Lcom/glympse/platform/common/LocPoint;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/glympse/platform/LocManager;->AddLocation(Lcom/glympse/platform/common/LocPoint;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 463
    :cond_0
    :goto_0
    return-void

    .line 458
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 460
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method public onProviderDisabled(Ljava/lang/String;)V
    .locals 0
    .parameter "provider"

    .prologue
    .line 469
    return-void
.end method

.method public onProviderEnabled(Ljava/lang/String;)V
    .locals 0
    .parameter "provider"

    .prologue
    .line 475
    return-void
.end method

.method public onStatusChanged(Ljava/lang/String;ILandroid/os/Bundle;)V
    .locals 0
    .parameter "strProvider"
    .parameter "nStatus"
    .parameter "oExtras"

    .prologue
    .line 480
    return-void
.end method
